package design.simdi.code.final_paper.core.entities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import design.simdi.code.final_paper.utils.StatusStudentCandidat;

/**
 * 
 * @author Marius Dumitriu - (Jun 24, 2010 - 3:24:13 PM)
 * 
 */
@Entity
@Table(name = "studentcandidates")
@AttributeOverrides( { @AttributeOverride(name = "id", column = @Column(name = "StudentCandidat_Id")) })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StudentCandidat extends ApplicationEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Student student;
	private Absolvent absolvent;
	private Domain domain;
	private Project project;
	private StatusStudentCandidat status;

	@OneToOne
	@JoinColumn(name = "Student_Fk")
	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@OneToOne
	@JoinColumn(name = "Domain_Fk")
	public Domain getDomain() {
		return domain;
	}

	public void setDomain(Domain domain) {
		this.domain = domain;
	}

	@Column(nullable = false, name = "Status")
	public StatusStudentCandidat getStatus() {
		return status;
	}

	public void setStatus(StatusStudentCandidat status) {
		this.status = status;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@OneToOne
	@JoinColumn(name = "Project_Fk")
	public Project getProject() {
		return project;
	}

	public void setAbsolvent(Absolvent absolvent) {
		this.absolvent = absolvent;
	}

	@OneToOne
	@JoinColumn(name = "Absolvent_Fk")
	public Absolvent getAbsolvent() {
		return absolvent;
	}

}
